

def stat_example1():
  #agents Ag1 and Ag2 are logged into ACD1
  time.sleep(6)
  r11 = StAg1.OpenStat("TotalTalkStatusTime")
  r12 = StAg1.OpenStat("TotalNumberInternalCalls")  
  r13 = StAg1.OpenStat("TotalLoginTime")
  r21 = StAg2.OpenStat("TotalTalkStatusTime")
  r22 = StAg2.OpenStat("TotalNumberInternalCalls")  
  r23 = StAg2.OpenStat("TotalLoginTime")  
  time.sleep(6)
  
  LocalTserver.MakeCall(DN10.number, ACD1.numberForCall)
  LocalTserver.Wait(DN10.number)
  receiver1 = LocalTserver.AnswerOnAlertingDN([DN1.number, DN2.number])
  time.sleep(6) #Agent is talking
  LocalTserver.HoldCall(DN10.number)
  LocalTserver.Wait(DN10.number)   
  LocalTserver.MakeCall(DN10.number, ACD1.numberForCall)
  LocalTserver.Wait(DN10.number)  
  receiver2 = LocalTserver.AnswerOnAlertingDN([DN1.number, DN2.number])  # call should go to another number
  time.sleep(6) #Agent is talking  
  LocalTserver.ReleaseCall(receiver1)
  LocalTserver.Wait()
  LocalTserver.ReleaseCall(receiver2)
  LocalTserver.Wait() 
  
  StAg1.PeekStat(r11)
  StAg1.PeekStat(r12)
  StAg1.PeekStat(r13)
  StAg2.PeekStat(r21)
  StAg2.PeekStat(r22)
  StAg2.PeekStat(r23)
  StAg1.CloseStat(r11)
  StAg1.CloseStat(r12)
  StAg1.CloseStat(r13)
  StAg2.CloseStat(r21)
  StAg2.CloseStat(r22)
  StAg2.CloseStat(r23)  